Skip to content

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

public void AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)

View source (opens in a new tab)

Summary: Adds a collection of key/value pairs to the cache in a single batch operation.

Parameters

NameTypeDescription
pairsIEnumerable> (opens in a new tab)The collection of key/value pairs to add.

Remarks

An existing key has its value replaced. When a key repeats, the last occurrence wins.

Exceptions

TypeCondition
System.ArgumentNullException (opens in a new tab)pairs is null.